$(function(){
	init();
})
function init(){
	var usr = sessionStorage.getItem("usr");
	$('#usr').html(usr);
}

$('.btnBox a.save').on('tap',function(){
	var oldPwd=$('#oldPwd').val();
	var newPwd=$('#newPwd').val();
	var againPwd=$('#againNewPwd').val();
	var arr={
		hs_action_id:"save",
		hf_s_id:"WD11",
		hf_srv_id:"Zv_jcus_changepw",
		hs_passwd:oldPwd,
		hs_new_passwd:newPwd,
		hs_con_passwd:againPwd
	};
	getAjaxRequest(arr,function(result){
		console.log(result);
		if(result.bs_result==BS_RESULT.OK){
			dialog('Message', 'Your Password has change successfully', 1);
			var $dialog = $('#dialog');
			$dialog.show();
			$('#comfirmBtn').html('Close');
			$('.mui-icon-closeempty').hide();
			$dialog.find('.comfirmBtn').one('click', function() {
			    $dialog.hide();
			    $dialog.remove();
			});		
		}else{
			dialog('<img src="'+MPJ.base+'/resources/images/account/remind.png" />Save Failed', result.bs_message, 1);
		    var $dialog = $('#dialog');
		    $dialog.show();
		    $('#comfirmBtn').html('Back');
		    $dialog.find('.comfirmBtn').one('click', function() {
		        $dialog.hide();
		        $dialog.remove();
		    });
		}
		
	});
})
